package com.foodsafe.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.google.gson.annotations.Expose;

/**
 * Additivecategory entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "additivecategory", catalog = "foodsafe")
public class Additivecategory implements java.io.Serializable {

	// Fields

	@Expose
	private Integer additiveCategoryId;
	@Expose
	private String additiveCategoryName;
	@Expose
	private String additiveCategoryDescr;
	private Set<Additive> additives = new HashSet<Additive>(0);

	// Constructors

	/** default constructor */
	public Additivecategory() {
	}

	/** full constructor */
	public Additivecategory(String AdditiveCategoryName,
			String AdditiveCategoryDescr, Set<Additive> additives) {
		this.additiveCategoryName = AdditiveCategoryName;
		this.additiveCategoryDescr = AdditiveCategoryDescr;
		this.additives = additives;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "AdditiveCategoryId", unique = true, nullable = false)
	public Integer getAdditiveCategoryId() {
		return this.additiveCategoryId;
	}

	public void setAdditiveCategoryId(Integer AdditiveCategoryId) {
		this.additiveCategoryId = AdditiveCategoryId;
	}

	@Column(name = "AdditiveCategoryName", length = 32)
	public String getAdditiveCategoryName() {
		return this.additiveCategoryName;
	}

	public void setAdditiveCategoryName(String AdditiveCategoryName) {
		this.additiveCategoryName = AdditiveCategoryName;
	}

	@Column(name = "AdditiveCategoryDescr", length = 64)
	public String getAdditiveCategoryDescr() {
		return this.additiveCategoryDescr;
	}

	public void setAdditiveCategoryDescr(String AdditiveCategoryDescr) {
		this.additiveCategoryDescr = AdditiveCategoryDescr;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "additivecategory")
	public Set<Additive> getAdditives() {
		return this.additives;
	}

	public void setAdditives(Set<Additive> additives) {
		this.additives = additives;
	}

}